package com.turing.post.organization.util;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.DropdownList;
import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 发卡商分支机构
 * 
 * @author zxp
 * @Dec 18, 2012
 */
@Remote
@Local
public interface IssueBranchDao {

	/**
	 * 根据发卡商机构号查询发卡商分支机构
	 * 
	 * @param issueBranchNo
	 *            发卡商编号
	 * @return IssueBranch 发卡商分支机构
	 */
	public IssueBranch getIssueBranchByIssueBranchNo(String issueBranchNo);

	/**
	 * 根据发卡商机构名称查询发卡商分支机构
	 * 
	 * @param issueBranchName
	 *            发卡商名称
	 * @return IssueBranch 发卡商分支机构
	 */
	public IssueBranch getIssueBranchByIssueBranchName(String issueBranchName);

	/**
	 * 分页查询发卡商机构列表
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @param issueBranchNo
	 *            发卡商机构编号
	 * @param issueBranchName
	 *            发卡商机构名称
	 * @param regionNo
	 *            行政地区编码
	 * @param status
	 *            状态
	 * @param page
	 *            页数
	 * @return List 发卡商分支机构列表
	 */
	public List<IssueBranch> getIssueBranchList(PCPSWebInput webInput,
			String issueBranchNo, String issueBranchName, String regionNo,
			String status, String allowActivate, Integer page);

	/**
	 * 查询发卡商机构表记录条数
	 * 
	 * @param webInput
	 *            日志记录对象
	 * @return BigInteger 记录条数
	 */
	public BigInteger getIssueBranchTotal(PCPSWebInput webInput,
			String issueBranchNo, String issueBranchName, String regionNo,
			String status, String allowActivate);

	/**
	 * 新增发卡商分支机构
	 * 
	 * @param issueBranch
	 *            发卡商分支机构
	 */
	public void insertIssueBranch(IssueBranch issueBranch)
			throws PCPSApplicationException;

	/**
	 * 修改发卡商分支机构
	 * 
	 * @param issueBranch
	 *            发卡商分支机构
	 */
	public void updateIssueBranch(IssueBranch issueBranch)
			throws PCPSApplicationException;

	/**
	 * 获取发卡商分支机构报表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<Object[]> getIssueBranchReport(PCPSWebInput webInput);

	/**
	 * 获取调拨机构下拉列表
	 * 
	 * @param webInput
	 * @return
	 */
	public List<DropdownList> getTransferBrachDropDownListBy(
			PCPSWebInput webInput);

	public IssueBranch getIssueBranchByIssueBranchNoForUpdate(
			String issueBranchNo);

	// /**
	// * @根据登录用户机构号查询下拉树机构
	// * @param operBranchNo
	// * @return
	// */
	// public List<OrganTreeList> getIssueBranchListByIssueBranchNo(
	// String branchNo, Integer minLen);
	//
	// /**
	// * @树形分层目录判断查询
	// * @param operBranchNo
	// * @return
	// */
	// public Integer getIssueBranchMinIssueBranchNo(String branchNo);

	/**
	 * 查询某发卡商下的发卡分支机构列表
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<IssueBranch> getAllIssueBranchByIssueCompanyNo(
			String issueCompanyNo);

	/**
	 * 根据发卡机构号，时间段查询授信额度结余统计表
	 * 
	 * @param webInput
	 * @param issueBranchNo
	 * @param startdate
	 * @param enddate
	 * @return
	 */
	public List<Object[]> getCreditAccDetailByIssueBranch(
			PCPSWebInput webInput, String issueBranchNo, String startdate,
			String enddate);

	public void deleteIssueBranch(String branchNo)
			throws PCPSApplicationException;
	
	public List<Object[]> getIssueBranchFeeForTranDate(String issueCompNo, String saleBranchs, Date trandate) throws PCPSApplicationException;
	
	
	/**
	 * 查询发卡商下有激活权限的发卡分支机构列表
	 * 
	 * @param issueCompanyNo
	 * @return
	 */
	public List<IssueBranch> getIssueBranchAllowActivateByIssueCompanyNo(
			String issueCompanyNo);

}
